﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using YasharEl.Infrastructure.EntityModel;
using System.Runtime.Serialization;

namespace YasharEl.Infrastructure.Core.Prototype
{
    [Serializable]
    public class PropertyTypeMismatchException : DomainModelException
    {
        private readonly string propertyKey;
        private readonly Type dataType;

        public string PropertyKey
        {
            get { return propertyKey; }
        }

        public Type DataType
        {
            get { return dataType; }
        }

        public PropertyTypeMismatchException(string propertyKey, Type dataType)
            : base(string.Format("Input property {0} type mismatch. Property type is {1}.",
            propertyKey, dataType))
        {
            this.propertyKey = propertyKey;
            this.dataType = dataType;
        }

        protected PropertyTypeMismatchException(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
        }
    }
}
